import request from '@/utils/request'

export function fetchList(query) {
  return request({
    url: '/article/list',
    method: 'get',
    params: query,
    baseURL: '/dev-api'
  })
}

export function fetchArticle(id) {
  return request({
    url: '/article/detail',
    method: 'get',
    params: {
      id
    },
    baseURL: '/dev-api'
  })
}

export function fetchPv(pv) {
  return request({
    url: '/article/pv',
    method: 'get',
    params: {
      pv
    },
    baseURL: '/dev-api'
  })
}

export function createArticle(data) {
  return request({
    url: '/article/create',
    method: 'post',
    data,
    baseURL: '/dev-api'
  })
}

export function updateArticle(data) {
  return request({
    url: '/article/update',
    method: 'post',
    data,
    baseURL: '/dev-api'
  })
}

export function edcxList(data) {
  return request({
    url: '/ljjy/edcx/list',
    method: 'get',
    params: data
  })
}
export function edcxDetailList(data) {
  return request({
    url: '/ljjy/edcx/detailList',
    method: 'get',
    params: data
  })
}

export function accountList(data) {
  return request({
    url: '/queryAccount/getAll',
    method: 'get',
    params: data
  })
}

export function accounBalance(data) {
  return request({
    url: '/queryAccount/balance',
    method: 'get',
    params: data
  })
}

export function accounFlow(data) {
  return request({
    url: '/queryAccount/flow',
    method: 'get',
    params: data
  })
}

// 交易明细查询导出
export function exportXLS(query) {
  return request({
    url: '/queryAccount/exportXls',
    method: 'get',
    responseType: "blob",
    params: query
  })
}

export function getQueryPayInfoList(query) {
  return request({
    url: '/pay/paymentApplication/queryPayInfoList',
    method: 'get',
    params:query
  })
}

// 授权支付额度变动情况查询导出
export function payQuotaChanSearchExportXls(query) {
  return request({
    url: '/pay/account/exportXls',
    method: 'get',
    responseType: "blob",
    params:query
  })
}
